package com.hmdp;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public class Main {
    public static void main(String[] args) {
        // 获取当前时间
        LocalDateTime now = LocalDateTime.now();

        // 设置解锁时间为次日0点
        LocalDateTime unlockTime = now.plusDays(1).truncatedTo(ChronoUnit.DAYS);

        // 计算时间差
        Duration duration = Duration.between(now, unlockTime);
        Long hours = duration.toHours();

        // 输出剩余小时数
        System.out.println("还剩 " + hours + " 小时");
    }
}
